import { defineStore } from "pinia";
import type { ReportDataModel } from "@/api/data/model/index"
import { requestMockData } from "@/api/data/index"

//定义state类型
interface stateType {
    mockData: ReportDataModel
}

const useMockDataStore = defineStore("mock", {
    state: (): stateType => {
        return {
            mockData: {}
        }
    },
    actions: {
        //请求mock数据
        async getMock() {
            const result = await requestMockData()
            this.mockData = result
        }
    },
    getters: {}
})

export default useMockDataStore